

import junit.framework.Test; 
import junit.framework.TestSuite; 
import junit.framework.TestCase; 

/** 
* Complex Tester. 
* 
* @author <Authors name> 
* @since <pre>05/07/2017</pre> 
* @version 1.0 
*/ 
public class ComplexTest extends TestCase {

public ComplexTest(String name) { 
super(name); 
} 

public void setUp() throws Exception { 
super.setUp(); 
} 

public void tearDown() throws Exception { 
super.tearDown(); 
} 

/** 
* 
* Method: add(Complex c) 
* 
*/ 
public void testAdd() throws Exception { 
//TODO: Test goes here...
    Complex r1 = new Complex(1,2);
    Complex r2 = new Complex(2,3);
    String actual = String.valueOf(r1.add(r2));
    assertEquals("(3.0+5.0i)",actual);

} 

/** 
* 
* Method: minus(Complex c) 
* 
*/ 
public void testMinus() throws Exception { 
//TODO: Test goes here...
    Complex r1 = new Complex(2,3);
    Complex r2 = new Complex(3,4);
    String actual = String.valueOf(r1.minus(r2));
    assertEquals("(-1.0-1.0i)",actual);
} 

/** 
* 
* Method: multiply(Complex c) 
* 
*/ 
public void testMultiply() throws Exception { 
//TODO: Test goes here...
    Complex r1 = new Complex(-4,6);
    Complex r2 = new Complex(2,3);
    String actual = String.valueOf(r1.multiply(r2));
    assertEquals("(-26.0)",actual);
} 

/** 
* 
* Method: divide(Complex c) 
* 
*/ 
public void testDivide() throws Exception { 
//TODO: Test goes here...
    Complex r1 = new Complex(2,3);
    Complex r2 = new Complex(4,6);
    String actual = String.valueOf(r1.divide(r2));
    assertEquals("(2.6)",actual);
} 

/** 
* 
* Method: toString() 
* 
*/ 
public void testToString() throws Exception { 
//TODO: Test goes here... 
} 



public static Test suite() { 
return new TestSuite(ComplexTest.class); 
} 
} 
